<?php

namespace App\Http\Controllers\Web;

use App\Api\Serializer\CustomSerializer;
use App\Http\Controllers\BaseController;
use App\Http\Requests\Admin\CategoryRequest;
use App\Models\Category;
use App\Transformers\CategoryTransformer;
use Illuminate\Http\Request;

class CategoryController extends BaseController
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        $all =cache()->remember('category_index', 120, function () { $all=Category::where('is_locked',1)->get();return $all;});
        return $this->response->item($all,new CategoryTransformer(),function ($resource, $fractal) {
            $fractal->setSerializer(new CustomSerializer());
        });
    }



    /**
     * Display the specified resource.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */



}
